package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CareLogMapper;
import com.ruoyi.system.domain.CareLog;
import com.ruoyi.system.service.ICareLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 护理日志Service业务层处理
 * 
 * @author 王帅
 * @date 2024-11-03
 */
@Service
public class CareLogServiceImpl extends ServiceImpl<CareLogMapper,CareLog> implements ICareLogService

{
    @Autowired
    private CareLogMapper careLogMapper;

    /**
     * 查询护理日志
     * 
     * @param id 护理日志主键
     * @return 护理日志
     */
    @Override
    public CareLog selectCareLogById(Long id)
    {
        return careLogMapper.selectCareLogById(id);
    }

    /**
     * 查询护理日志列表
     * 
     * @param careLog 护理日志
     * @return 护理日志
     */
    @Override
    public List<CareLog> selectCareLogList(CareLog careLog)
    {
        return careLogMapper.selectCareLogList(careLog);
    }

    /**
     * 新增护理日志
     * 
     * @param careLog 护理日志
     * @return 结果
     */
    @Override
    public int insertCareLog(CareLog careLog)
    {
        careLog.setCreateTime(DateUtils.getNowDate());
        return careLogMapper.insertCareLog(careLog);
    }

    /**
     * 修改护理日志
     * 
     * @param careLog 护理日志
     * @return 结果
     */
    @Override
    public int updateCareLog(CareLog careLog)
    {
        careLog.setUpdateTime(DateUtils.getNowDate());
        return careLogMapper.updateCareLog(careLog);
    }

    /**
     * 批量删除护理日志
     * 
     * @param ids 需要删除的护理日志主键
     * @return 结果
     */
    @Override
    public int deleteCareLogByIds(String ids)
    {
        return careLogMapper.deleteCareLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除护理日志信息
     * 
     * @param id 护理日志主键
     * @return 结果
     */
    @Override
    public int deleteCareLogById(Long id)
    {
        return careLogMapper.deleteCareLogById(id);
    }
}
